#pragma warning(disable:4996)
#include"CacLop.h"
#include<conio.h>
#include<string.h>
#include<iostream>
#include<Windows.h>
void main()
{
	system("cls");
	int i, j;
	const int n = 3;
	char t[10], l[10];
	int hp, hb, dtb;
	SVCQ *a[n], *tg;
	for (i = 0; i<n; i++)
	{
		cout << "\n Nhap sv thu " << i + 1 << " ";
		cout << "\n Nhap Ten: "; gets(t);
		cout << "\n Nhap Lop: "; gets(l);
		cout << "\n Nhap hoc Phi: "; cin >> hp;
		cout << "\n Nhap Diem TB: "; cin >> dtb;
		cout << "\n Nhap hoc Bong: "; cin >> hb;
		a[i] = new SVCQ(t, l, hp, dtb, hb);
	}
	cout << "\n\n Thong tin sv truoc khi sap xep: ";
	for (i = 0; i<n; i++)
		a[i]->display();
	for (i = 0; i<n - 1; i++)
	for (j = i + 1; j<n; j++)
	if (*a[j]>*a[i])
	{
		tg = a[i];
		a[i] = a[j];
		a[j] = tg;
	}
	cout << "\n --------------------";
	cout << "\n\n Thong tin sap xep giam dan theo Diem TB: ";
	for (i = 0; i<n; i++)
		a[i]->display();
	getch();
}
